<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 1.参数问题：
        // 1.1放入两个参数
        const sum = (num1, num2) => {
            return num1 + num2
        }
        // 1.2放入一个参数(一个参数可以省略括号)
        const power = (num) =>{
            return num * num
        }

        // 2.返回值的问题
        // 2.1 函数代码块中有多行代码时
        const test = ()=>{
            // 1.打印hello world
            console.log("hello world");
            // 2.打印hello vuejs
            console.log("hello vuejs");
        }

        // 2.2  函数代码块中只有一行代码
        // const mul = (num1,num2)=>{
        //     return num1*num2
        // }
        const mul  = (num1,num2) => num1 * num2
        console.log(mul(20,30));

        // const demo = ()=>{
        //     console.log("hello Demo")
        // }

        const demo = ()=>console.log('Hello demo')  //Hello demo
        console.log(demo());  //undefined

    </script>
</body>
</html>